import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";

@Index("goods_id", ["goodsId"], {})
@Index("attr_id", ["attrId"], {})
@Entity("rrz_goods_attr", { schema: "rrzcms" })
export class RrzGoodsAttr {
  @PrimaryGeneratedColumn({
    type: "bigint",
    name: "id",
    comment: "商品属性id自增",
    unsigned: true,
  })
  id: string;

  @Column("bigint", {
    name: "goods_id",
    comment: "商品id",
    unsigned: true,
    default: () => "'0'",
  })
  goodsId: string;

  @Column("text", { name: "attr_value", nullable: true, comment: "属性值" })
  attrValue: string | null;

  @Column("int", {
    name: "attr_id",
    comment: "属性id",
    unsigned: true,
    default: () => "'0'",
  })
  attrId: number;
}
